﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using AnalyseCrmMana;
using System.Data;

namespace AnalyseCRM.Operation
{
    public partial class ProductAllAnalyse2 : System.Web.UI.Page
    {
        public string strJYLData = "";
        string type = "0";  // 
        string type2 = "0";  // 行业板块（0），地区板块(1),风格板块(2)
        public string strTitleBZ = @"各产品交易市场\\币种交易量统计";
        public string strCateBZ = "['股票', '基金']";
        public string strPlace = "";

        public string strTitleMoney = @"各产品交易市场\\币种交易量统计";
        public string strCateMoney = "['股票', '基金']";
        public string strYJMoney = "";


        public string strTitlePeople = @"各产品交易市场\\币种交易量统计";
        public string strCatePeople = "['股票', '基金']";
        public string strJYPeople = "";


        public string Tile1 = "'最近3个月Top5交易量统计'";
        public StringBuilder XCate1 = new StringBuilder();
        public StringBuilder Xseries1 = new StringBuilder();


        public string Tile2 = "'最近3个月Top5交易金额统计'";
        public StringBuilder XCate2 = new StringBuilder();
        public StringBuilder Xseries2 = new StringBuilder();

        public string Tile3 = "'最近3个月Top5交易人数统计'";
        public StringBuilder XCate3 = new StringBuilder();
        public StringBuilder Xseries3 = new StringBuilder();

        public string strTitleYJPecent = "'最近3个月Top5佣金额及占比统计'";
        public StringBuilder XCateYJPecent = new StringBuilder();
        public StringBuilder XseriesYJPecent = new StringBuilder();



        public string Tile4 = "'最近3个月各类型基金交易次数'";
        public StringBuilder XCate4 = new StringBuilder();
        public StringBuilder Xseries4 = new StringBuilder();


        public string Tile5 = "'最近3个月各类型基金交易金额'";
        public StringBuilder XCate5 = new StringBuilder();
        public StringBuilder Xseries5 = new StringBuilder();

        public string Tile6 = "'最近3个月各类型基金交易客户数'";
        public StringBuilder XCate6 = new StringBuilder();
        public StringBuilder Xseries6 = new StringBuilder();

        public string Tile7 = "'最近3个月各类型基金佣金额及占比统计'";
        public StringBuilder XCate7 = new StringBuilder();
        public StringBuilder Xseries7 = new StringBuilder();

        public StringBuilder strAll1 = new StringBuilder(); // 最近3个月
        public StringBuilder strAll2 = new StringBuilder(); //bb
        public StringBuilder strAll3 = new StringBuilder(); //cc

        /// <summary>
        ///  add by jy
        ///  add date 2013-2-25
        ///  note: 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Params["Type"] != null)
            {
                type = Request.Params["Type"].ToString();
                GetJYPlaceString(type);  // 币种交易量
                GetYJMoneyString(type);  // 佣金贡献统计
                GetYJPelpleString(type); // 交易人数统计

                strAll1.Append(strTitleBZ);
                strAll1.Append("@");
                strAll1.Append(strCateBZ);
                strAll1.Append("@");
                strAll1.Append(strPlace);
                strAll1.Append("#");
                strAll1.Append(strTitleMoney);
                strAll1.Append("@");
                strAll1.Append(strCateMoney);
                strAll1.Append("@");
                strAll1.Append(strYJMoney);
                strAll1.Append("#");
                strAll1.Append(strTitlePeople);
                strAll1.Append("@");
                strAll1.Append(strCatePeople);
                strAll1.Append("@");
                strAll1.Append(strJYPeople);
                Response.Write(strAll1.ToString());
                Response.End();
            }

            if (Request.Params["Type2"] != null)
            {
                type2 = Request.Params["Type2"].ToString();
                GetTop5JYLString(type2, "0");   // 交易量
                GetTop5JYLString(type2, "1");   // 交易金额
                GetTop5JYLString(type2, "2");   // 交易人数
                GetTop5YJPecentString(type);    // 交易佣金百分比

                strAll2.Append(Tile1);
                strAll2.Append("@");
                strAll2.Append(XCate1);
                strAll2.Append("@");
                strAll2.Append(Xseries1);
                strAll2.Append("#");
                strAll2.Append(Tile2);
                strAll2.Append("@");
                strAll2.Append(XCate2);
                strAll2.Append("@");
                strAll2.Append(Xseries2);
                strAll2.Append("#");
                strAll2.Append(Tile3);
                strAll2.Append("@");
                strAll2.Append(XCate3);
                strAll2.Append("@");
                strAll2.Append(Xseries3);
                strAll2.Append("#");
                strAll2.Append(Tile4);
                strAll2.Append("@");
                strAll2.Append(XCate4);
                strAll2.Append("@");
                strAll2.Append(Xseries4);
                Response.Write(strAll2.ToString());
                Response.End();
            }
            else
            {
                GetJYPlaceString(type);  // 币种交易量
                GetYJMoneyString(type);  // 佣金贡献统计
                GetYJPelpleString(type); // 交易人数统计

                GetTop5JYLString(type2, "0");   // 交易量
                GetTop5JYLString(type2, "1");   // 交易金额
                GetTop5JYLString(type2, "2");   // 交易人数
                GetTop5YJPecentString(type);    // 交易佣金百分比

                GetLatest3MonthJYString("JYNum");
                GetLatest3MonthJYString("JYMoney");
                GetLatest3MonthJYString("JYPeopleNum");
                GetLatest3JJYJPecentString();
            }

            //strAll3.Append(Tile5);
            //strAll3.Append("@");
            //strAll3.Append(XCate5);
            //strAll3.Append("@");
            //strAll3.Append(Xseries5);
            //strAll3.Append("#");
            //strAll3.Append(Tile6);
            //strAll3.Append("@");
            //strAll3.Append(XCate6);
            //strAll3.Append("@");
            //strAll3.Append(Xseries6);
        }
        /// <summary>
        /// 各产品交易市场\币种交易量统计
        /// <param name="type"></param>
        /// <returns></returns>
        private void GetJYPlaceString(string type)
        {

            ProductAllAnalyseMana allAnaly = new ProductAllAnalyseMana();
            DataSet dsJYPlace = allAnaly.GetPlaceTypeAnalyse(type);
            if ((dsJYPlace != null) && (dsJYPlace.Tables.Count > 0) && (dsJYPlace.Tables[0].Rows.Count > 0))
            {
                strPlace = "[";
                #region 上海
                DataView dvSH = dsJYPlace.Tables[0].DefaultView;
                dvSH.RowFilter = " JYPlace = '上海'";
                dvSH.Sort = " JYType asc ";
                strPlace += "{ name: '上海', data: [";
                int intGp = 0;
                int intJJ = 0;
                for (int i = 0; i < dvSH.Count; i++)
                {
                    if (dvSH[i].Row.ItemArray[1].ToString() == "股票")
                    {
                        intGp = int.Parse(dvSH[i].Row.ItemArray[2].ToString());
                    }
                    if (dvSH[i].Row.ItemArray[1].ToString() == "基金")
                    {
                        intJJ = int.Parse(dvSH[i].Row.ItemArray[2].ToString());
                    }

                }
                strPlace += intGp + "," + intJJ;
                strPlace += "],stack: 'type' }";
                #endregion
                #region 深圳
                DataView dvSZ = dsJYPlace.Tables[0].DefaultView;
                dvSZ.RowFilter = " JYPlace = '深圳'";
                dvSZ.Sort = " JYType asc ";
                strPlace += ",{ name: '深圳', data: [";

                for (int i = 0; i < dvSZ.Count; i++)
                {
                    if (dvSZ[i].Row.ItemArray[1].ToString() == "股票")
                    {
                        intGp = int.Parse(dvSZ[i].Row.ItemArray[2].ToString());
                    }
                    if (dvSZ[i].Row.ItemArray[1].ToString() == "基金")
                    {
                        intJJ = int.Parse(dvSZ[i].Row.ItemArray[2].ToString());
                    }

                }
                strPlace += intGp + "," + intJJ;
                strPlace += "],stack: 'type' }";
                #endregion
            }
            else
            {
                strPlace = @"[{ name: '上海', data: [0,0],stack: 'type' },{ name: '深圳', data: [0,0],stack: 'type' }";
            }

            DataSet dsJYCurrency = allAnaly.GetCurrencyTypeAnalyse(type);
            if ((dsJYCurrency != null) && (dsJYCurrency.Tables.Count > 0) && (dsJYCurrency.Tables[0].Rows.Count > 0))
            {
                #region 上海
                DataView dvRMB = dsJYCurrency.Tables[0].DefaultView;
                dvRMB.RowFilter = " JYCurrency = '人民币'";
                dvRMB.Sort = " JYType asc ";
                strPlace += ",{ name: '人民币', data : [";
                int intGp = 0;
                int intJJ = 0;
                for (int i = 0; i < dvRMB.Count; i++)
                {
                    if (dvRMB.Table.Rows[i][1] != DBNull.Value)
                    {
                        if (dvRMB[i].Row.ItemArray[1].ToString() == "股票")
                        {
                            intGp = int.Parse(dvRMB[i].Row.ItemArray[2].ToString());
                        }
                        if (dvRMB[i].Row.ItemArray[1].ToString() == "基金")
                        {
                            intJJ = int.Parse(dvRMB[i].Row.ItemArray[2].ToString());
                        }
                    }
                }
                strPlace += intGp + "," + intJJ;
                strPlace += "],stack: 'Money' }";
                #endregion
                #region 深圳
                DataView dvWB = dsJYCurrency.Tables[0].DefaultView;
                dvWB.RowFilter = " JYCurrency = '外币'";
                dvWB.Sort = " JYType asc ";
                strPlace += ",{ name: '外币', data : [";

                for (int i = 0; i < dvWB.Count; i++)
                {
                    if (dvWB.Table.Rows[i][1] != DBNull.Value)
                    {
                        if (dvWB[i].Row.ItemArray[1].ToString() == "股票")
                        {
                            intGp = int.Parse(dvWB[i].Row.ItemArray[2].ToString());
                        }
                        if (dvWB[i].Row.ItemArray[1].ToString() == "基金")
                        {
                            intJJ = int.Parse(dvWB[i].Row.ItemArray[2].ToString());
                        }
                    }

                }
                strPlace += intGp + "," + intJJ;
                strPlace += "], stack: 'Money' }";
                strPlace += "]";
                #endregion
            }
            else
            {
                strPlace += @",{ name: '人民币', data : [0,0],stack: 'Money' },{ name: '外币', data : [0,0], stack: 'Money' }]";
            }
        }


        /// <summary>
        /// 佣金贡献统计
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        private void GetYJMoneyString(string type)
        {
         
            ProductAllAnalyseMana allAnaly = new ProductAllAnalyseMana();
            DataSet dsYJMoney = allAnaly.GetYJStatis(type);
            if ((dsYJMoney != null) && (dsYJMoney.Tables[0].Rows.Count > 0))
            {
                strYJMoney = "[";
                #region 上海
                DataView dvSH = dsYJMoney.Tables[0].DefaultView;
                dvSH.RowFilter = " JYPlace = '上海'";
                dvSH.Sort = " JYType asc ";
                strYJMoney += "{ name: '上海', data: [";
                int intGp = 0;
                int intJJ = 0;
                for (int i = 0; i < dvSH.Count; i++)
                {
                    if (dvSH[i].Row.ItemArray[1].ToString() == "股票")
                    {
                        intGp = int.Parse(dvSH[i].Row.ItemArray[2].ToString());
                    }
                    if (dvSH[i].Row.ItemArray[1].ToString() == "基金")
                    {
                        intJJ = int.Parse(dvSH[i].Row.ItemArray[2].ToString());
                    }

                }
                strYJMoney += intGp + "," + intJJ;
                strYJMoney += "],stack: 'type' }";
                #endregion
                #region 深圳
                DataView dvSZ = dsYJMoney.Tables[0].DefaultView;
                dvSZ.RowFilter = " JYPlace = '深圳'";
                dvSZ.Sort = " JYType asc ";
                strYJMoney += ",{ name: '深圳', data: [";

                for (int i = 0; i < dvSZ.Count; i++)
                {
                    if (dvSZ[i].Row.ItemArray[1].ToString() == "股票")
                    {
                        intGp = int.Parse(dvSZ[i].Row.ItemArray[2].ToString());
                    }
                    if (dvSZ[i].Row.ItemArray[1].ToString() == "基金")
                    {
                        intJJ = int.Parse(dvSZ[i].Row.ItemArray[2].ToString());
                    }

                }
                strYJMoney += intGp + "," + intJJ;
                strYJMoney += "],stack: 'type' }";
                strYJMoney += "]";

                #endregion
            }
            else
            {
                strYJMoney = "[{ name: '上海', data: [0,0],stack: 'type' },{ name: '深圳', data: [0,0],stack: 'type' }]";
            }
        }

        /// <summary>
        /// 交易人数统计
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        private void GetYJPelpleString(string type)
        {
         
            ProductAllAnalyseMana allAnaly = new ProductAllAnalyseMana();
            DataSet dsYJMoney = allAnaly.GetYJStatis(type);
            if ((dsYJMoney != null) && (dsYJMoney.Tables[0].Rows.Count > 0))
            {
                strJYPeople = "[";
                #region 上海
                DataView dvSH = dsYJMoney.Tables[0].DefaultView;
                dvSH.RowFilter = " JYPlace = '上海'";
                dvSH.Sort = " JYType asc ";
                strJYPeople += "{ name: '上海', data: [";
                int intGp = 0;
                int intJJ = 0;
                for (int i = 0; i < dvSH.Count; i++)
                {
                    if (dvSH[i].Row.ItemArray[1].ToString() == "股票")
                    {
                        intGp = int.Parse(dvSH[i].Row.ItemArray[2].ToString());
                    }
                    if (dvSH[i].Row.ItemArray[1].ToString() == "基金")
                    {
                        intJJ = int.Parse(dvSH[i].Row.ItemArray[2].ToString());
                    }

                }
                strJYPeople += intGp + "," + intJJ;
                strJYPeople += "],stack: 'type' }";
                #endregion
                #region 深圳
                DataView dvSZ = dsYJMoney.Tables[0].DefaultView;
                dvSZ.RowFilter = " JYPlace = '深圳'";
                dvSZ.Sort = " JYType asc ";
                strJYPeople += ",{ name: '深圳', data: [";

                for (int i = 0; i < dvSZ.Count; i++)
                {
                    if (dvSZ[i].Row.ItemArray[1].ToString() == "股票")
                    {
                        intGp = int.Parse(dvSZ[i].Row.ItemArray[2].ToString());
                    }
                    if (dvSZ[i].Row.ItemArray[1].ToString() == "基金")
                    {
                        intJJ = int.Parse(dvSZ[i].Row.ItemArray[2].ToString());
                    }

                }
                strJYPeople += intGp + "," + intJJ;
                strJYPeople += "],stack: 'type' }";
                strJYPeople += "]";

                #endregion
            }
            else
            {
                strJYPeople = "[{ name: '上海', data: [0,0],stack: 'type' },{ name: '深圳', data: [0,0],stack: 'type' }]";
            }
        }



        /// <summary>
        /// Top5交易量统计
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        private void GetTop5JYLString(string type2, string PlateType)
        {
            switch (PlateType)
            {
                case "0":
                    XCate1.Append("[");  // X名称
                    Xseries1.Append("[{ name: '', data: [");  // X值
                    break;
                case "1":
                    XCate2.Append("[");  // X名称
                    Xseries2.Append("[{ name: '', data: [");  // X值
                    break;
                case "2":
                    XCate3.Append("[");  // X名称
                    Xseries3.Append("[{ name: '', data: [");  // X值
                    break;
            }

            ProductAllAnalyseMana allAnaly = new ProductAllAnalyseMana();
            DataSet dsYJMoney = new DataSet();
            switch (PlateType)
            {
                case "0":
                    dsYJMoney = allAnaly.GetTop5JYLCount(type2);
                    break;
                case "1":
                    dsYJMoney = allAnaly.GetTop5JYMoneyCount(type2);
                    break;
                case "2":
                    dsYJMoney = allAnaly.GetTop5JYPeopleCount(type2);
                    break;
            }
            if ((dsYJMoney != null) && (dsYJMoney.Tables[0].Rows.Count > 0))
            {
                switch (PlateType)
                {
                    case "0":
                        DataView dvJYL = dsYJMoney.Tables[0].DefaultView;
                        for (int i = 0; i < dvJYL.Count; i++)
                        {

                            XCate1.Append("'");
                            XCate1.Append(dvJYL[i][0] == null ? "" : dvJYL[i][0].ToString());
                            XCate1.Append("'");
                            if (i != dvJYL.Count - 1)
                            {
                                XCate1.Append(",");
                            }

                            Xseries1.Append(dvJYL[i][1] == null ? "0" : dvJYL[i][1].ToString());
                            if (i != dvJYL.Count - 1)
                            {
                                Xseries1.Append(",");
                            }

                        }
                        XCate1.Append("]");  // X名称
                        Xseries1.Append("],stack: 'type' }]");
                        break;
                    case "1":
                        DataView dvJYMoney = dsYJMoney.Tables[0].DefaultView;
                        for (int i = 0; i < dvJYMoney.Count; i++)
                        {

                            XCate2.Append("'");
                            XCate2.Append(dvJYMoney[i][0] == null ? "" : dvJYMoney[i][0].ToString());
                            XCate2.Append("'");
                            if (i != dvJYMoney.Count - 1)
                            {
                                XCate2.Append(",");
                            }

                            Xseries2.Append(dvJYMoney[i][1] == null ? "0" : dvJYMoney[i][1].ToString());
                            if (i != dvJYMoney.Count - 1)
                            {
                                Xseries2.Append(",");
                            }

                        }
                        XCate2.Append("]");  // X名称
                        Xseries2.Append("],stack: 'type' }]");
                        break;
                    case "2":
                        DataView dvJYPeopleNum = dsYJMoney.Tables[0].DefaultView;
                        for (int i = 0; i < dvJYPeopleNum.Count; i++)
                        {

                            XCate3.Append("'");
                            XCate3.Append(dvJYPeopleNum[i][0] == null ? "" : dvJYPeopleNum[i][0].ToString());
                            XCate3.Append("'");
                            if (i != dvJYPeopleNum.Count - 1)
                            {
                                XCate3.Append(",");
                            }

                            Xseries3.Append(dvJYPeopleNum[i]["JYNum"] == null ? "0" : dvJYPeopleNum[i]["JYNum"].ToString());
                            if (i != dvJYPeopleNum.Count - 1)
                            {
                                Xseries3.Append(",");
                            }

                        }
                        XCate3.Append("]");  // X名称
                        Xseries3.Append("],stack: 'type' }]");
                        break;
                }

            }
        }

        /// <summary>
        /// Top5佣金交易百分比统计
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        private void GetTop5YJPecentString(string type)
        {
            XCateYJPecent.Append("[");  // X名称

            ProductAllAnalyseMana allAnaly = new ProductAllAnalyseMana();
            DataSet dsYJMoney = allAnaly.GetTop5YJMoneyPecent(type);
            if ((dsYJMoney != null) && (dsYJMoney.Tables[0].Rows.Count > 0))
            {
                DataView dvJYL = dsYJMoney.Tables[0].DefaultView;
                XseriesYJPecent.Append("[{ name: '佣金额', type: 'column',yAxis: 1, data: [");  // X值
                for (int i = 0; i < dvJYL.Count; i++)
                {
                    XCateYJPecent.Append("'");
                    XCateYJPecent.Append(dvJYL[i][0] == null ? "" : dvJYL[i][0].ToString());
                    XCateYJPecent.Append("'");
                    if (i != dvJYL.Count - 1)
                    {
                        XCateYJPecent.Append(",");
                    }


                    XseriesYJPecent.Append(dvJYL[i][1] == null ? "0" : dvJYL[i][1].ToString());
                    if (i != dvJYL.Count - 1)
                    {
                        XseriesYJPecent.Append(",");
                    }
                }
                XseriesYJPecent.Append("],stack: 'type' }");

                XseriesYJPecent.Append(",{ name: '占比',type: 'spline',  data: [");  // 百分比值
                for (int i = 0; i < dvJYL.Count; i++)
                {
                    XseriesYJPecent.Append(dvJYL[i][2] == null ? "0" : (decimal.Parse(dvJYL[i][2].ToString()) * 100).ToString());
                    if (i != dvJYL.Count - 1)
                    {
                        XseriesYJPecent.Append(",");
                    }
                }
                XseriesYJPecent.Append("],stack: 'type' }]");
                XCateYJPecent.Append("]");  // X名称

            }
        }

        /// <summary>
        /// 最近3个月各类型基金交易次数
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        private void GetLatest3MonthJYString(string strStatisColumn)
        {
            switch (strStatisColumn)
            {
                case "JYNum":
                    XCate4.Append("[");  // X名称
                    Xseries4.Append("[{ name: '', data: [");  // X值
                    break;
                case "JYMoney":
                    XCate5.Append("[");  // X名称
                    Xseries5.Append("[{ name: '', data: [");  // X值
                    break;
                case "JYPeopleNum":
                    XCate6.Append("[");  // X名称
                    Xseries6.Append("[{ name: '', data: [");  // X值
                    break;
            }

            ProductAllAnalyseMana allAnaly = new ProductAllAnalyseMana();
            DataSet dsYJMoney = allAnaly.GetLatest3MonthJYCount(strStatisColumn);
            if ((dsYJMoney != null) && (dsYJMoney.Tables[0].Rows.Count > 0))
            {
                switch (strStatisColumn)
                {
                    case "JYNum":
                        DataView dvJYL = dsYJMoney.Tables[0].DefaultView;
                        for (int i = 0; i < dvJYL.Count; i++)
                        {

                            XCate4.Append("'");
                            XCate4.Append(dvJYL[i][0] == null ? "" : dvJYL[i][0].ToString());
                            XCate4.Append("'");
                            if (i != dvJYL.Count - 1)
                            {
                                XCate4.Append(",");
                            }

                            Xseries4.Append(dvJYL[i][1] == null ? "0" : dvJYL[i][1].ToString());
                            if (i != dvJYL.Count - 1)
                            {
                                Xseries4.Append(",");
                            }

                        }
                        XCate4.Append("]");  // X名称
                        Xseries4.Append("],stack: 'type' }]");
                        break;
                    case "JYMoney":
                        DataView dvJYMoney = dsYJMoney.Tables[0].DefaultView;
                        for (int i = 0; i < dvJYMoney.Count; i++)
                        {

                            XCate5.Append("'");
                            XCate5.Append(dvJYMoney[i][0] == null ? "" : dvJYMoney[i][0].ToString());
                            XCate5.Append("'");
                            if (i != dvJYMoney.Count - 1)
                            {
                                XCate5.Append(",");
                            }

                            Xseries5.Append(dvJYMoney[i][1] == null ? "0" : dvJYMoney[i][1].ToString());
                            if (i != dvJYMoney.Count - 1)
                            {
                                Xseries5.Append(",");
                            }

                        }
                        XCate5.Append("]");  // X名称
                        Xseries5.Append("],stack: 'type' }]");
                        break;
                    case "JYPeopleNum":
                        DataView dvJYPeopleNum = dsYJMoney.Tables[0].DefaultView;
                        for (int i = 0; i < dvJYPeopleNum.Count; i++)
                        {

                            XCate6.Append("'");
                            XCate6.Append(dvJYPeopleNum[i][0] == null ? "" : dvJYPeopleNum[i][0].ToString());
                            XCate6.Append("'");
                            if (i != dvJYPeopleNum.Count - 1)
                            {
                                XCate6.Append(",");
                            }

                            Xseries6.Append(dvJYPeopleNum[i][1] == null ? "0" : dvJYPeopleNum[i][1].ToString());
                            if (i != dvJYPeopleNum.Count - 1)
                            {
                                Xseries6.Append(",");
                            }

                        }
                        XCate6.Append("]");  // X名称
                        Xseries6.Append("],stack: 'type' }]");
                        break;
                }

            }
        }


        /// <summary>
        /// 最近3个月各类型基金佣金额及占比统计
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        private void GetLatest3JJYJPecentString()
        {
            XCate7.Append("[");  // X名称

            ProductAllAnalyseMana allAnaly = new ProductAllAnalyseMana();
            DataSet dsYJMoney = allAnaly.GetLatest3JJYJPecent();
            if ((dsYJMoney != null) && (dsYJMoney.Tables[0].Rows.Count > 0))
            {
                DataView dvJYL = dsYJMoney.Tables[0].DefaultView;
                Xseries7.Append("[{ name: '佣金额', type: 'column',yAxis: 1, data: [");  // X值
                for (int i = 0; i < dvJYL.Count; i++)
                {
                    XCate7.Append("'");
                    XCate7.Append(dvJYL[i][0] == null ? "" : dvJYL[i][0].ToString());
                    XCate7.Append("'");
                    if (i != dvJYL.Count - 1)
                    {
                        XCate7.Append(",");
                    }


                    Xseries7.Append(dvJYL[i][1] == null ? "0" : dvJYL[i][1].ToString());
                    if (i != dvJYL.Count - 1)
                    {
                        Xseries7.Append(",");
                    }
                }
                Xseries7.Append("],stack: 'type' }");

                Xseries7.Append(",{ name: '占比',type: 'spline',  data: [");  // 百分比值
                for (int i = 0; i < dvJYL.Count; i++)
                {
                    Xseries7.Append(dvJYL[i][2] == null ? "0" : (decimal.Parse(dvJYL[i][2].ToString()) * 100).ToString());
                    if (i != dvJYL.Count - 1)
                    {
                        Xseries7.Append(",");
                    }
                }
                Xseries7.Append("],stack: 'type' }]");
                XCate7.Append("]");  // X名称

            }
        }
    }
}